/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */



import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.ConnectException;
import java.net.InetAddress;
import java.net.Socket;
import java.net.UnknownHostException;

/**
 *
 * @author ntomio
 */
public class ClientREP {

    // Constructor
    public ClientREP() throws UnknownHostException, IOException
    {
        try
        {
            Socket socket = new Socket (InetAddress.getByName("localhost"), 8080);

            ObjectOutputStream fluxDeSortie = new ObjectOutputStream (socket.getOutputStream());
            fluxDeSortie.writeObject (new String ("REP,2,1,120,150"));
            socket.close();
        }
        catch (ConnectException e)
        {
            System.err.println(e.getMessage());
        }
        catch (UnknownHostException e)
        {
            System.err.println(e.getMessage());
        }
        catch (IOException e)
        {
            System.err.println(e.getMessage());
        }
    }


  public static void main(String[] args) throws UnknownHostException, IOException
  {
        System.out.println("-- Création du client :");
        ClientREP client = new ClientREP ();
  }
}
